package com.link.gateway.core.redis.redisclient;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.ScanResult;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author gsan
 * @create 2019/3/28
 */
public class LinkRedisSingleClient  implements LinkRedisClient {

    private Jedis jedis;

    public LinkRedisSingleClient(Jedis jedis) {
        this.jedis = jedis;
    }

    @Override
    public String get(String key) {
        return jedis.get(key);
    }

    @Override
    public String hget(String key, String propertyKey) {
        return jedis.hget(key,propertyKey);
    }

    @Override
    public void close() {
        jedis.close();
    }

    @Override
    public Long ttl(String s) {
        return jedis.ttl(s);
    }

    @Override
    public Long expire(String s, Integer tokenExpire) {
        return jedis.expire(s,tokenExpire);
    }

    @Override
    public boolean exists(String loginInfoMapKey) {
        return jedis.exists(loginInfoMapKey);
    }


    @Override
    public List<String> hmget(String key, String... arr) {
        return jedis.hmget(key,arr);
    }

    @Override
    public Long hdel(String loginInfoMapKey, String key) {
        return jedis.hdel(loginInfoMapKey,key);
    }

    @Override
    public Long hset(String loginInfoMapKey, String key, String value) {
        return jedis.hset(loginInfoMapKey,key,value);
    }

    @Override
    public String hmset(String mapKey, Map<String, String> map) {
        return jedis.hmset(mapKey,map) ;
    }

    @Override
    public String set(String key, String value) {
        return jedis.set(key,value);
    }

    @Override
    public String set(String key, String value, String nxxx, String expx, int time) {
        return jedis.set(key,value,nxxx,expx,time);
    }

    @Override
    public List<String> brpop(int i, String key) {
        return jedis.brpop(i,key);
    }

    @Override
    public long llen(String key) {
        return jedis.llen(key);
    }

    @Override
    public Long lpush(String key, String value) {
        return jedis.lpush(key,value) ;
    }

    @Override
    public Long sadd(String key, String[] value) {
        return jedis.sadd(key,value);
    }

    @Override
    public long scard(String key) {
        return jedis.scard(key);
    }

    @Override
    public String spop(String key) {
        return jedis.spop(key);
    }

    @Override
    public Set<String> keys(String s) {
        return jedis.keys(s);
    }

    @Override
    public Set<byte[]> keys(byte[] pattern) {
        return jedis.keys(pattern);
    }

    @Override
    public Long del(String[] keyStrs) {
        return jedis.del(keyStrs);
    }

    @Override
    public Long del(String mutexKey) {
        return jedis.del(mutexKey);
    }

    @Override
    public String setex(String mutexKey, int i, String y) {
        return jedis.setex(mutexKey,i,y);
    }

    @Override
    public String select(int dbIndex) {
        return jedis.select(dbIndex);
    }

    @Override
    public Set<String> hkeys(String key) {
        return jedis.hkeys(key);
    }

    @Override
    public List<byte[]> mget(byte[][] keys) {
        return jedis.mget(keys);
    }

    @Override
    public Map<String, String> hgetAll(String key) {
        return jedis.hgetAll(key);
    }

    @Override
    public List<String> lrange(String key, long start, long end) {
        return jedis.lrange(key,start,end);
    }

    @Override
    public String ltrim(String key, long start, long end) {
        return jedis.ltrim(key,start,end);
    }

    @Override
    public String lindex(String key, long index) {

        return jedis.lindex(key,index);
    }

    @Override
    public Long pexpire(String key, long milliseconds) {
        return jedis.pexpire(key,milliseconds);
    }

    @Override
    public Long hincrBy(String key, String field, long value) {
        return jedis.hincrBy(key,field,value);
    }

    @Override
    public Double hincrByFloat(String key, String field, double value) {
        return jedis.hincrByFloat(key,field,value);
    }

    @Override
    public Long setnx(String key, String value) {
        return jedis.setnx(key,value);
    }

    @Override
    public String getSet(String key, String value) {
        return jedis.getSet(key,value);
    }

    @Override
    public String rpop(String key) {
        return jedis.rpop(key);
    }

    @Override
    public Boolean scriptExists(String key, String sha1) {
        return jedis.scriptExists(sha1);
    }

    @Override
    public String scriptLoad(String script, String key) {
        return jedis.scriptLoad(script);
    }

    @Override
    public Object evalsha(String sha1, int keyCount, String... params) {
        return jedis.evalsha(sha1,keyCount,params);
    }

    @Override
    public Boolean hexists(String key, String field) {
        return jedis.hexists(key,field);
    }

    @Override
    public ScanResult<Map.Entry<String, String>> hscan(String key, String cursor) {
        return jedis.hscan(key, cursor);
    }

    @Override
    public Object eval(String script, List<String> keys, List<String> args) {
        return jedis.eval(script, keys, args);
    }
}
